import { createApp } from 'vue'
import Antd, { message } from 'ant-design-vue'
import 'ant-design-vue/dist/reset.css'
// import * as Icons from '@ant-design/icons-vue'
import App from './App.vue'
import router from './router'
import store from './store'
import axios from 'axios'
// import fetch from 'node-fetch'

//配置请求前缀
axios.defaults.baseURL = 'http://localhost:8081/api'

createApp(App).use(store).use(router).use(Antd).mount('#app')

// 解决跨域问题，强制修改响应头（仅限开发环境）  
axios.interceptors.response.use(response => {  
    if (process.env.NODE_ENV === 'development') {  
      response.headers['Access-Control-Allow-Origin'] = '*';  
    }  
    return response;  
});  
